/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * bocciawii
 * Copyright (C) Grupo de trabajo ULE 2010 <ulewii@googlegroups.com>
 * 
 * teclado is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * teclado is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "boton.h"


Boton::Boton(std::string id, int x, int y):LinkedContainer(x, y)
{
	_id = id;

	_selectable = 1;

	_up = _id;
	_down = _id;
	_left = _id;
	_right = _id;
}

Boton::~Boton()
{
}

std::string Boton::GetID()
{
	return _id;
}

std::string Boton::OnDir(int dir)
{
	switch (dir)
	{
		case DIR_IZQ:
			return _left;
			
		case DIR_DER:
			return _right;
			
		case DIR_ARR:
			return _up;
			
		case DIR_ABA:
			return _down;
	}
}


void Boton::ToDir(int dir, std::string id)
{
	switch (dir)
	{
		case DIR_IZQ:
			_left = id;
			break;
			
		case DIR_DER:
			_right = id;
			break;
			
		case DIR_ARR:
			_up = id;
			break;
			
		case DIR_ABA:
			_down = id;
			break;
	}
}